package com.cg.managesystem.service.impl;

import com.cg.managesystem.entity.Post;
import com.cg.managesystem.mapper.PostMapper;
import com.cg.managesystem.service.PostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created on 2019/8/14 by Tinchi
 **/
@Service
public class PostServiceImpl implements PostService {

    @Autowired
    private PostMapper postMapper;;

    @Override
    public List<Post> findAllPosts() {
        return postMapper.selectAll();
    }

    @Override
    public int addPost(Post post) {
        return postMapper.insert(post);
    }

    @Override
    public Post deletePostById(Integer id) {
        return null;
    }

    @Override
    public int updatePostById(Post post) {
        return 0;
    }

    @Override
    public int findPostById(Integer id) {
        return 0;
    }
}
